import { http } from '@/utils/http/axios';

/**
 * @description: 根据用户id获取用户菜单
 */
export function adminMenus() {
  return http.request({
    url: '/System/SysMenu/GetMenu',
    method: 'GET',
  });
}

/**
 * 获取tree菜单列表
 * @param params
 */
export function getMenuList(params?) {
  return http.request({
    url: '/System/SysMenu/GetMenuList',
    method: 'GET',
    params,
  });
}

/**
 * 新增菜单
 * @returns 
 */
export function add(data) {
  return http.request({
    url: '/System/SysMenu/Add',
    method: 'POST',
    data
  });
}


/**
 * 修改菜单
 * @returns 
 */
export function update(data) {
  return http.request({
    url: '/System/SysMenu/Update',
    method: 'POST',
    data
  });
}

/**
 * 删除菜单
 * @returns 
 */
export function deleteById(id) {
  return http.request({
    url: `/System/SysMenu/Delete?id=${id}`,
    method: 'POST',
  });
}